package object1;

/**
 * @Author: Cjj
 * 僵尸
 */
public class JiangShi {
     String name;
     int hp;//生命值
     int attack;//攻击力

    public JiangShi(String name,int hp,int attack){
        this.name=name;
        this.hp=hp;
        this.attack=attack;
    }
     //僵尸吃植物
    public void eat(ZhiWu zw){
      System.out.println(this.name+"正在在吃"+zw.name+"植物");
      zw.hp=this.attack;
      System.out.println("植物血量剩余:"+zw.hp);
    }
}
